package com.itrip.redisconfig;
import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

public class AlipayConfig {

//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    public static String app_id = "2021000116666103";

    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCXsaHuVZosZphCtoBEsjewyW1eXsauNt5tsGST5jDgIZCML7poTLwilj313zMED75OWo3+vC1AJ6uOKXz6RZqgiPmGiozn/66oX4ryJcbCbVJZCYDlWppy8gmjJrXXWu7Gg4fFFDDVGjxYWlnEnoaUPnqEeYUEaVvWy+Q01caG6HhTJ6KoUpomZ7W462E6b27y4Vtpfwi8D+pzeMlilM+/xZGdLnoica+Y7K5ZX9DPwBhuNL0GGSHn7wyV0R4FEwpxy+wmqDelEKcTA+pbRk4KbeMFBofs2SDuWrfx5JKu0EBl60eJWtxNm5x8BzRiP1xd1OAAD1yQK5fsrd90JkKrAgMBAAECggEAaCRieJ66TttMkxh6LS9xPmS7Oju1CSvQPtwH4OX7DhTdCPFHd42e59vfw+otOw+X5nES5RzJsC7L/7iJ/cRFaQtAy9ZY8Hm/rgaR/LZko1ysWUZGAK/YMyvp4+GSm7vpC86HKo03DUaKwVmeIXd4C1Rthn9rC+FNVMT78i4Fst3ckuI8ARqYc5QjD8OmZAsBA44cqnubhEMTseL9MgSqMdgatf0eAveKzewLG5KCvnYmUd3SzA3Lb3Q9ucLYDB9lk1LI6su+RN4rZ248OlND3QH7OmK6iJ9HFwzSkTCcnuzAG59ryXyl0kuqvQr72W1WAnDccSPIuRS/MQywJ0WEmQKBgQDa3hbhlbN5dTSnz+mBf6gBVhgDdWPfklMoD7GtxzPV3oTbnQiWK4vtesEDwm1RsV0EOe+pRtpto00RvHcjV6LiyA24s3Pg2clWV8v8W6O+rCxD4RPPHBn7LKXgJe+rKxf495/h9pKcdNq0+lbBYUddhTPSQVK+LcpR0NWign/N9QKBgQCxbgonmb0qow0iUHRp9W7CJ1N6iFiNr10uyS1Rh2Wpyx4rvREJlycLRjo58KMoE6JLJnW+YlJmPijcUsj7aters5h59cfv5Y6hIsNWNwiVEVqvCo+D94A0Afeb45XUTYRWPrDcNKdguPe5oDvJZpHpq44yzXR3qoj21CAyCuXKHwKBgQDJKTTok5oIeSQzVNHudzEoQUQC8cMgurF5catB6IQI/uMnolZBB7ctRxTd6rZlTloKx2EyOXALMvtj4M+ziRmpzGtoJm/L6v+1Py66PFPsrPxmSxnU0qRCik/PC68TqKD48Edf/SvVZ0WY7zoLtOhN2V6+0dFGAHoi5olkOwNSfQKBgQCgnr0SnFpi/rglGDBKu6RIntEzW7rOiLISaIxeAfRGgVoOvlluFSeDTU/oo68P2LZS0b5FWzy80gira0YGU/JpvWuK/LTCt00nEhFDOw7J46v0Sdsh3Cxy6FT/CkfYqVPjv1zb+86KAOhBYoy9Bd2Ra3yPAO8uZXMX/3Al3TeogQKBgDbe7Ur3CqZmN47tlvfqESVtVoXZTLkYhZeg0CAIDP8a8fOCRPeVQeSJ3oWjHMWEDpKTZlM42vk++cGvQX5HuxJuOMpbgFR0U/w6FMHCuAodBCe2aG2UspcY51jITtjtSkKCIvupVwP7dJT4PpeXglB7TgCEd2yNQTTf6fecRj1V";

    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAm10tOe7LgRPLR5grNxNdL4p2/V084MYEfQwHVUEth0dOqg6wwQLQJwpPk7EhOwWY0qZgJ7w0E4NVnIUeIZ1oIHSASIthUHK2yUZiKfoSeD+DAjxAmvnaXuBJ+3CCiAv1UK5vJonr3Bir5HsMnc4GZLA9IynWph4XgIxKkzGpT9ckzK+rrgmeAjHw0+NYWQbkR2UhcMfS0zIWhy+cLHSVY32Qq0RoQJe+WKWBq4abhIFb4zvvSIgcs1CE+Mw25lnUK+4tqVGV6qydLKFPxVgJlWt0SIkCQslRJZppeXqgDXR+ghZ6zhwNgg3qwVyPNIFDG2kHxkyklUDBy//kAgftlwIDAQAB";

    /*// 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String notify_url = "http://localhost:8080/payDemo_war_exploded/notify_url.jsp";

    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String return_url = "http://localhost:8080/payDemo_war_exploded/return_url.jsp";*/

    // 签名方式
    public static String sign_type = "RSA2";

    // 字符编码格式
    public static String charset = "utf-8";

    // 支付宝网关
    public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";

    // 支付宝网关
    public static String log_path = "C:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}
